<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var p = {
      name: '小明'
    }
    function show (a, b) {
      console.log(this);
      console.log(a, b);
    }


    // call
    // show(1, 5)// this指向window对象
    show.call(p, 1, 6)// this指向传入的第一个参数的对象

    console.log(fn);
    //apply
    show.apply(p, [2, 6])//


    //bind, 返回当前函数对象
    fn = show.bind(p, 2, 8)
    console.log(fn);



  </script>
</body>

</html>